<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib uri="/WEB-INF/page-base.tld" prefix="w"%>
<%String path=request.getContextPath(); %>

<div class="easyui-panel" data-options="doSize:false,layoutH:47,border:false" style="margin:5px">
	<form method="post" action="/products/ProductPage@inStock_update.page" class="pageForm">
		<w:hidden bind="bean.attrid"/>
		<div class="ui-formContent">
			<p>
				<label style="width:130px;text-align:right">商品名称：</label>
				<w:write bind="bean.name"/>
			</p>
			<p>
				<label style="width:130px;text-align:right">销售属性：</label>
				<w:write bind="bean.attrname"/>
			</p>
			<p>
				<label style="width:130px;text-align:right"><font class="red">*</font>总库存：</label>
				<w:text id="chuichuichui" bind="bean.totalamount" styleClass="easyui-numberbox" dataOptions="required:true" style="width:200px"/>
			</p>
			<p style="float:left">
				<label style="width:130px;text-align:right">可用库存：</label>
				<span id="keyyyyy"><w:write bind="bean.amount"/></span>
			</p>
			<p>
				<label style="width:130px;text-align:right">冻结库存：</label>
				<w:hidden bind="bean.djamount"/>
				<w:write bind="bean.djamount"/>
			</p>
			
		</div>
	</form>
</div>
<div class="ui-buttonBar">
	<a href="javascript:;" class="easyui-linkbutton marginR16" iconCls="icon_save" onclick="$w.doWinForm();">保 存</a>
	<a href="javascript:;" class="easyui-linkbutton" iconCls="icon_cancel" onclick="$w.closeCurrWin()">取 消</a>
</div>
<script>
$('#chuichuichui').numberbox({
	min:0,
	onChange:function(newValue,oldValue){
		var dj=0;
		var sum=0;
		if($getByName("bean.djamount",$w.currWin()).val()!=""){
			dj=parseInt($getByName("bean.djamount",$w.currWin()).val());
		}
		if(newValue)sum=parseInt(newValue);
		var c=sum-dj;
		if(c<0)c=0;
		$("#keyyyyy").text(c);
	}
});
</script>